/* eslint-disable */
import * as echarts from "echarts";

export default {
    dataInput(data, title, fun, r = ['60%', '78%'], c = ["50%", "44.5%"], b = '3%', ttop = "42%", l = '0%') {
        let option = {
            title: {
                text: title,
                left: 'center',
                top: ttop,
                textStyle: {
                    fontSize: 25,
                    textBorderColor: "#1296db",
                    textBorderWidth: "2",
                    textBorderType: "solid",
                },
            },
            backgroundColor: "rgba(6, 19, 31, 0)",
            tooltip: {
                trigger: 'item'
            },
            legend: {
                icon: 'circle',
                bottom: b,
                itemGap: 10,
                textStyle: {
                    fontSize: 15,
                    fontWeight: 500,
                    color: "inherit"
                },
                formatter: fun,
            },
            series: [
                {
                    name: title,
                    type: 'pie',
                    radius: r,
                    center: c,
                    avoidLabelOverlap: false,
                    itemStyle: {
                        // borderRadius: 10,
                        borderWidth: 10,
                        borderColor: 'rgba(6,19,31,0)'
                    },
                    label: {
                        normal: {
                            show: true,
                            position: 'inner',
                            textStyle: {
                                textBorderColor: "white",
                                textBorderWidth: "2",
                                textBorderType: "solid",
                                color: "black",
                                fontSize: 20,
                            },
                        }
                    },
                    clockwise: false,
                    emphasis: {
                        label: {
                            show: true,
                            fontSize: '40',
                            fontWeight: 'bold'
                        }
                    },
                    labelLine: {
                        normal: {
                            length: 5,
                            length2: 3,
                            smooth: true
                        },
                    },
                    data: data
                }
            ]
        }
        return option
    },
    dataInput1(data, title, fun, r = ['60%', '78%'], c = ["50%", "44.5%"], b = '3%', ttop = "42%", l = '42%', tleft = '9%') {
        let option = {
            title: {
                text: title,
                left: tleft,
                top: ttop,
                textStyle: {
                    fontSize: 25,
                    textBorderColor: "#1296db",
                    textBorderWidth: "2",
                    textBorderType: "solid",
                },
            },
            backgroundColor: "rgba(6, 19, 31, 0)",
            tooltip: {
                trigger: 'item'
            },
            legend: {
                icon: 'circle',
                top: "center",
                left: l,
                itemGap: 15,
                textStyle: {
                    fontSize: 15,
                    fontWeight: 500,
                    color: "inherit"
                },
                formatter: fun,
            },
            series: [
                {
                    name: title,
                    type: 'pie',
                    radius: r,
                    center: c,
                    avoidLabelOverlap: false,
                    itemStyle: {
                        // borderRadius: 10,
                        borderWidth: 10,
                        borderColor: 'rgba(6,19,31,0)'
                    },
                    label: {
                        normal: {
                            show: false,
                            position: 'inner',
                            textStyle: {
                                textBorderColor: "white",
                                textBorderWidth: "2",
                                textBorderType: "solid",
                                color: "black",
                                fontSize: 10,
                            },
                        }
                    },
                    clockwise: false,
                    emphasis: {
                        label: {
                            show: false,
                            fontSize: '20',
                            fontWeight: 'bold'
                        }
                    },
                    labelLine: {
                        normal: {
                            length: 5,
                            length2: 3,
                            smooth: true
                        },
                    },
                    data: data
                }
            ]
        }
        return option
    }
}